<template>
    <fieldset>
        <legend>child组件</legend>
        <h1>Child组件</h1>
        <h2>来自父亲的关心：{{g}}</h2>
        <button @click="send">点击给父亲送个礼物</button>
    </fieldset>
</template>

<script>
export default {
    data(){
        return{
            p:'七匹狼皮带'
        }
    },
    props: {
        g:{
            type: String
        }
    },
    methods: {
        send(){
            this.$emit("re",this.p)
        }
    },
    mounted(){
        this.$bus.$on('get2',input=>{
            console.log(input);
        })
    }
}

</script>